/**
 * 
 */
package com.jframework.module.usps.beans.rates;

import java.util.ArrayList;
import java.util.List;

import com.jframework.module.usps.beans.USPSBaseResponseObject;
import com.jframework.module.usps.beans.USPSObject;


/**
 * @author AJain
 */
public class IntlRateResponse 
       extends USPSBaseResponseObject
       implements USPSObject 
{
    private List list = null;
    
    public IntlRateResponsePackage[] getPackage()
    {
	if (null == this.list) return null;
	IntlRateResponsePackage[] packageArray = new IntlRateResponsePackage[list.size()];
        return (IntlRateResponsePackage[]) list.toArray(packageArray);
    }

    
    public boolean addPackage(IntlRateResponsePackage aPackage)
    {
	if (null == this.list) this.list = new ArrayList();
        if (!list.contains(aPackage))
	  return list.add(aPackage);
        
        return false;
    }
    
    public void setPackage(IntlRateResponsePackage[] packages)
    {
        if (null != packages)        
         for (int i=0; i < packages.length; i++)
         {
            this.addPackage(packages[i]);
         }
    }


}
